﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="Jy123.Web.Manage.User.Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../css/custom/jquery.ui.css" rel="stylesheet" type="text/css" />
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery.js" type="text/javascript"></script>
    <script src="../js/jquery.ui.js" type="text/javascript"></script>
    <script src="../js/main.js" type="text/javascript"></script>
    <title>会员管理</title>
</head>
<body>
    <form id="form1" runat="server">
    <h4>
        <a href="#"><span>会员管理</span></a></h4>
    <div class="register">
        <ul>
            <li><a class="btnsty" href="index.aspx">所有会员</a></li>
            <li><a class="btnsty" href="index.aspx?s=5">正常会员</a></li>
            <li><a class="btnsty" href="index.aspx?s=0">等待验证会员</a></li>
            <li><a class="btnsty" href="index.aspx?s=2">未验证邮件会员</a></li>
            <li><a class="btnsty" href="index.aspx?s=1">锁定会员</a></li></ul>
            
    </div>
    <asp:Repeater runat="server" ID="Rpt_UserList">
        <HeaderTemplate>
            <table class="tblist">
                <tr>
                    <th>
                        编号
                    </th>
                    <th>
                        姓名
                    </th>
                    <th>
                        邮箱
                    </th>
                    <th>
                        状态
                    </th>
                    <th>
                        登录次数
                    </th>
                    <th>
                        推荐会员
                    </th>
                    <th>
                        注册时间
                    </th>
                    <th align="center">
                        操作
                    </th>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr id="<%#Eval("ID") %>">
                <td>
                    <%# Container.ItemIndex + 1 + pagesize * (cpage - 1)%>
                </td>
                <td>
                    <a href="AutoLogin.ashx?<%# Eval("ID")%>" target="_blank">
                        <%# Eval("UserName")%></a>
                </td>
                <td>
                    <a href="../../user/?r=<%# Eval("ID")%>" target="_blank">
                        <%# Eval("Email")%></a>
                </td>
                <td class="cred">
                    <%# ConvertStatus(Eval("State"))%>
                </td>
                <td>
                    <%# Eval("LoginTimes")%>
                </td>
                <td class="cred">
                    <%# Rec(Eval("isRec"))%>
                </td>
                <td>
                    <%# Convert.ToDateTime(Eval("RegTime")).ToShortDateString()%>
                </td>
                <td>
                    <a class="btnsty" href="UserEdit.aspx?UserID=<%# Eval("ID")%>">
                        编辑</a> 
                    <%# Rec(Eval("isRec"),Eval("ID"),1) %>
                    <a class="btnsty cred" href="javascript:del(<%# Eval("ID")%>);">
                                    删</a> 
                    <a class="btnsty" href="advanced.aspx?uid=<%# Eval("ID")%>&uName=<%# Eval("UserName").ToString()%>">
                                        高级</a>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
        <tr>
                <td colspan="8" style="text-align: right;">
                    <% =string.Format("当前{0}/{1},共{2}条记录", cpage, count[1], count[0]) + PageString((int)count[1], cpage, "Index.aspx?page=$num$")%>
                </td>
            </tr>
            </table>
        </FooterTemplate>
    </asp:Repeater>

    <div class="register">
        <h5>
            会员操作</h5>
        <ul>
            <li><a class="btnsty" href="javascript:delAll();">清空所有会员</a> </li>
        </ul>
        <ul class="bb">
            <li>输入会员姓名或邮箱搜索你要找的会员</li>
            <li>
                <asp:TextBox ID="Key" runat="server" Width="200" CssClass="text"></asp:TextBox></li>
            <li>
                <asp:Button ID="btnSearch" CssClass="button" runat="server" Text=" 搜索 " 
                    onclick="btnSearch_Click" /></li>
        </ul>
    </div>
    </form>
</body>
</html>

<script language="javascript" type="text/javascript">
function del(id)
{
    if(confirm('你确认删除此会员吗?'))
        self.location="?Type=del&id="+id;
}
function delAll()
{
    if(confirm('你确认删除所有会员吗?此操作不可逆！'))
        self.location="?Type=delAll";
}
function Recommended(id,flag,p)
{
    var str="你确定要推荐此会员吗？";
    if(flag==2)
    {
        str="你确定要取消推荐次会员吗？";
    }
    if(confirm(str))
        self.location="?Type=Recommended&pg="+p+"&id="+id+"&flag="+flag;
}

</script>

